/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "UePolicySet.h"

namespace oai::udr::model {

UePolicySet::UePolicySet() {
  m_PraInfosIsSet = false;
  m_SubscCatsIsSet = false;
  m_UePolicySectionsIsSet = false;
  m_UpsisIsSet = false;
  m_AllowedRouteSelDescsIsSet = false;
  m_AndspInd = false;
  m_AndspIndIsSet = false;
  m_Pei = "";
  m_PeiIsSet = false;
  m_OsIdsIsSet = false;
  m_SuppFeat = "";
  m_SuppFeatIsSet = false;
}

UePolicySet::~UePolicySet() {}

void UePolicySet::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const UePolicySet &o) {
  j = nlohmann::json();
  if (o.praInfosIsSet() || !o.m_PraInfos.empty())
    j["praInfos"] = o.m_PraInfos;
  if (o.subscCatsIsSet() || !o.m_SubscCats.empty())
    j["subscCats"] = o.m_SubscCats;
  if (o.uePolicySectionsIsSet() || !o.m_UePolicySections.empty())
    j["uePolicySections"] = o.m_UePolicySections;
  if (o.upsisIsSet() || !o.m_Upsis.empty())
    j["upsis"] = o.m_Upsis;
  if (o.allowedRouteSelDescsIsSet() || !o.m_AllowedRouteSelDescs.empty())
    j["allowedRouteSelDescs"] = o.m_AllowedRouteSelDescs;
  if (o.andspIndIsSet())
    j["andspInd"] = o.m_AndspInd;
  if (o.peiIsSet())
    j["pei"] = o.m_Pei;
  if (o.osIdsIsSet() || !o.m_OsIds.empty())
    j["osIds"] = o.m_OsIds;
  if (o.suppFeatIsSet())
    j["suppFeat"] = o.m_SuppFeat;
}

void from_json(const nlohmann::json &j, UePolicySet &o) {
  if (j.find("praInfos") != j.end()) {
    j.at("praInfos").get_to(o.m_PraInfos);
    o.m_PraInfosIsSet = true;
  }
  if (j.find("subscCats") != j.end()) {
    j.at("subscCats").get_to(o.m_SubscCats);
    o.m_SubscCatsIsSet = true;
  }
  if (j.find("uePolicySections") != j.end()) {
    j.at("uePolicySections").get_to(o.m_UePolicySections);
    o.m_UePolicySectionsIsSet = true;
  }
  if (j.find("upsis") != j.end()) {
    j.at("upsis").get_to(o.m_Upsis);
    o.m_UpsisIsSet = true;
  }
  if (j.find("allowedRouteSelDescs") != j.end()) {
    j.at("allowedRouteSelDescs").get_to(o.m_AllowedRouteSelDescs);
    o.m_AllowedRouteSelDescsIsSet = true;
  }
  if (j.find("andspInd") != j.end()) {
    j.at("andspInd").get_to(o.m_AndspInd);
    o.m_AndspIndIsSet = true;
  }
  if (j.find("pei") != j.end()) {
    j.at("pei").get_to(o.m_Pei);
    o.m_PeiIsSet = true;
  }
  if (j.find("osIds") != j.end()) {
    j.at("osIds").get_to(o.m_OsIds);
    o.m_OsIdsIsSet = true;
  }
  if (j.find("suppFeat") != j.end()) {
    j.at("suppFeat").get_to(o.m_SuppFeat);
    o.m_SuppFeatIsSet = true;
  }
}

std::map<std::string, PresenceInfo> &UePolicySet::getPraInfos() {
  return m_PraInfos;
}
void UePolicySet::setPraInfos(
    std::map<std::string, PresenceInfo> const &value) {
  m_PraInfos = value;
  m_PraInfosIsSet = true;
}
bool UePolicySet::praInfosIsSet() const { return m_PraInfosIsSet; }
void UePolicySet::unsetPraInfos() { m_PraInfosIsSet = false; }
std::vector<std::string> &UePolicySet::getSubscCats() { return m_SubscCats; }
void UePolicySet::setSubscCats(std::vector<std::string> const &value) {
  m_SubscCats = value;
  m_SubscCatsIsSet = true;
}
bool UePolicySet::subscCatsIsSet() const { return m_SubscCatsIsSet; }
void UePolicySet::unsetSubscCats() { m_SubscCatsIsSet = false; }
std::map<std::string, UePolicySection> &UePolicySet::getUePolicySections() {
  return m_UePolicySections;
}
void UePolicySet::setUePolicySections(
    std::map<std::string, UePolicySection> const &value) {
  m_UePolicySections = value;
  m_UePolicySectionsIsSet = true;
}
bool UePolicySet::uePolicySectionsIsSet() const {
  return m_UePolicySectionsIsSet;
}
void UePolicySet::unsetUePolicySections() { m_UePolicySectionsIsSet = false; }
std::vector<std::string> &UePolicySet::getUpsis() { return m_Upsis; }
void UePolicySet::setUpsis(std::vector<std::string> const &value) {
  m_Upsis = value;
  m_UpsisIsSet = true;
}
bool UePolicySet::upsisIsSet() const { return m_UpsisIsSet; }
void UePolicySet::unsetUpsis() { m_UpsisIsSet = false; }
std::map<std::string, PlmnRouteSelectionDescriptor> &
UePolicySet::getAllowedRouteSelDescs() {
  return m_AllowedRouteSelDescs;
}
void UePolicySet::setAllowedRouteSelDescs(
    std::map<std::string, PlmnRouteSelectionDescriptor> const &value) {
  m_AllowedRouteSelDescs = value;
  m_AllowedRouteSelDescsIsSet = true;
}
bool UePolicySet::allowedRouteSelDescsIsSet() const {
  return m_AllowedRouteSelDescsIsSet;
}
void UePolicySet::unsetAllowedRouteSelDescs() {
  m_AllowedRouteSelDescsIsSet = false;
}
bool UePolicySet::isAndspInd() const { return m_AndspInd; }
void UePolicySet::setAndspInd(bool const value) {
  m_AndspInd = value;
  m_AndspIndIsSet = true;
}
bool UePolicySet::andspIndIsSet() const { return m_AndspIndIsSet; }
void UePolicySet::unsetAndspInd() { m_AndspIndIsSet = false; }
std::string UePolicySet::getPei() const { return m_Pei; }
void UePolicySet::setPei(std::string const &value) {
  m_Pei = value;
  m_PeiIsSet = true;
}
bool UePolicySet::peiIsSet() const { return m_PeiIsSet; }
void UePolicySet::unsetPei() { m_PeiIsSet = false; }
std::vector<std::string> &UePolicySet::getOsIds() { return m_OsIds; }
void UePolicySet::setOsIds(std::vector<std::string> const &value) {
  m_OsIds = value;
  m_OsIdsIsSet = true;
}
bool UePolicySet::osIdsIsSet() const { return m_OsIdsIsSet; }
void UePolicySet::unsetOsIds() { m_OsIdsIsSet = false; }
std::string UePolicySet::getSuppFeat() const { return m_SuppFeat; }
void UePolicySet::setSuppFeat(std::string const &value) {
  m_SuppFeat = value;
  m_SuppFeatIsSet = true;
}
bool UePolicySet::suppFeatIsSet() const { return m_SuppFeatIsSet; }
void UePolicySet::unsetSuppFeat() { m_SuppFeatIsSet = false; }

} // namespace oai::udr::model
